<template>
  <div class="buypackage-search">
    <el-row :gutter="14" type="flex" justify="start">
      <el-col :span="20">
        <el-input
          v-model="search"
          style="width:200px;"
          placeholder="请输入资产名称"
          @keyup.enter.native="handleFilter"
        />
        <el-button type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
        <el-button size="medium" type="info" @click="clearParams">清空</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { buyPackageBus } from './eventBus'
export default {
  data() {
    return {
      search: ''
    }
  },
  methods: {
    handleFilter() {
      buyPackageBus.$emit('handleFilter', { search: this.search })
    },
    clearParams() {
      this.search = ''
      buyPackageBus.$emit('handleFilter', { search: this.search })
    }
  }
}
</script>

<style lang="scss">
.buypackage-search {
  width: 100%;
  height: 70px;
  line-height: 70px;
  min-width: 1003px;
  .shopping-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    .el-button {
      position: absolute;
      top: 25%;
      right: 0;
      .badge {
        position: absolute;
        top: 0;
      }
      .el-badge__content {
        font-size: 13px !important;
      }
    }
  }
  .shopping-content {
    width: 362px;
    position: absolute;
    right: 20px;
    top: 54px;
    z-index: 25;
    border: 1px solid #999;
    border-radius: 4px;
    padding: 0 20px 10px 20px;
    background-color: #fff;
    box-sizing: border-box;
    &-submit {
      width: 100%;
      height: 50px;
      line-height: 50px;
      position: relative;
      &-total {
        position: absolute;
        left: 0;
        height: 50px;
        line-height: 50px;
        display: block;
      }
      .el-button {
        float: right;
      }
    }
    &-item {
      width: 100%;
      height: 100px;
      line-height: 100px;
      margin-top: 22px;
      position: relative;
      margin-bottom: 18px;
      &-imgwrap {
        width: 110px;
        height: 99px;
        position: absolute;
        left: 0;
        overflow: hidden;
        img {
          height: 100%;
        }
      }
      &-title {
        width: 190px;
        height: 20px;
        line-height: 20px;
        position: absolute;
        right: 0;
        top: 10px;
        font-size: 18px;
        span {
          display: block;
          height: 20px;
          line-height: 20px;
        }
        .title {
          float: left;
        }
        .close {
          float: right;
          width: 20px;
          border-radius: 50%;
          background-color: rgb(202, 202, 202);
          text-align: center;
          color: red;
          cursor: pointer;
        }
        .close:hover {
          opacity: 0.8;
        }
      }
      &-price {
        position: absolute;
        bottom: 40px;
        right: 0;
        width: 190px;
        height: 20px;
        line-height: 20px;
        font-size: 18px;
        span {
          font-size: 16px;
          color: #999;
        }
      }
    }
  }
  ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
}
</style>
